<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/10/16
 * Time: 13:52
 */
namespace app\api\model;
use think\Controller;
use think\Model;
use think\Db;
class Banner extends Model
{
    public function banner()
    {
       $bannerArr = Db::name('banner')
            ->field('banner_id,banner_img,banner_link')
            ->where('is_del',0)->where('is_display',0)
            ->order('banner_sort','desc')
            ->limit(4)
            ->select();
        if(count($bannerArr)>0){
        	 foreach ($bannerArr as $key => $value) {
    	        $bannerArr[$key]['banner_img'] = addWaterByField($value['banner_img']);
        	 }
        }
        return $bannerArr;
    }
}